#!/usr/local/bin/python3

# example usage - ./test.py *.wav or python test.py *.wav

from pycdp import *

if __name__ == "__main__":  # python convention, but i think you can leave it out...
    print("ex_rototill.py")
    mono = cdp.housekeep.chans(4)
    print(mono.mode)
    norm = cdp.modify.loudness(3)

    dv = cdp.envel.dovetail(2)
    dv.infadedur = 1024
    dv.outfadedur = 1024
    dv.t = 1 # set time unit to samples

    dp = cdp.distort.pitch()
    dp.octvary = 2
    dp.c = 128

    dp2 = cdp.distort.pitch()
    dp2.octvary = 0.5
    dp2.c = 256

    cut = cdp.sfedit.cut(1)
    cut.start = 0
    cut.end = 20

    chain = []
    chain.append(mono)
    chain.append(cut)
    chain.append(mono)
    chain.append(cut)
    chain.append(dp)
    chain.append(dp)
    chain.append(mono)
    chain.append(dp2)
    chain.append(norm)
    chain.append(dv)

    output_files = cdp.run_chain(chain)

    print(output_files) # debug!
